package top.zosoft.handler;

import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.mqtt.MqttMessage;
import io.netty.handler.codec.mqtt.MqttMessageType;
import lombok.extern.slf4j.Slf4j;
import top.zosoft.SimpleHandler;
import top.zosoft.annotation.Process;

import java.util.concurrent.TimeUnit;

/**
 * @author neal
 * @date 2023/12/20  16:17
 */
@Slf4j
@Process(type= MqttMessageType.DISCONNECT)
public class MqttDisConnent implements MqttHandler{
    @Override
    public void handler(ChannelHandlerContext ctx, MqttMessage msg) {
        log.debug("收到DISCONNECT请求");
        ctx.channel().close();
    }
}
